package com.zlyx.easy.web.web.mybatis;

import java.util.List;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zlyx.easy.core.annotations.Desc;
import com.zlyx.easy.mybatis.mapper.provider.MybatisSqlProvider;

/**
 * @Auth 赵光
 * @Describle
 * @Date 2019年1月4日 下午9:06:53
 */
public interface AbstractMapper<T> extends BaseMapper<T> {

	@Desc("分页")
	@SelectProvider(method = MybatisSqlProvider.PAGE, type = MybatisSqlProvider.class)
	public List<?> page(String sql, int pageSize, int pageNum);

	@Desc("查询")
	@SelectProvider(method = MybatisSqlProvider.SQL, type = MybatisSqlProvider.class)
	public List<?> select(String sql);

	@Desc("查询")
	@SelectProvider(method = MybatisSqlProvider.SQL, type = MybatisSqlProvider.class)
	public Object selectOne(String sql);

	@Desc("更新")
	@UpdateProvider(method = MybatisSqlProvider.SQL, type = MybatisSqlProvider.class)
	public int update(String sql);

	@Desc("删除")
	@DeleteProvider(method = MybatisSqlProvider.SQL, type = MybatisSqlProvider.class)
	public int delete(String sql);

	@Desc("新增")
	@InsertProvider(method = MybatisSqlProvider.SQL, type = MybatisSqlProvider.class)
	public int insert(String sql);
}
